def calculator(user_input):
    for i in user_input:
        if i in ['+', '-', '*', '/']:
            opr = i
            break
    else:
        print("你必须输入[+ - * /]")
        return

    num1, operator, num2 = user_input.partition(opr)
    num1 = int(num1.strip())
    operator = operator.strip()
    num2 = int(num2.strip())

    if operator == '+':
        result = num1 + num2
        print("结果为：", result)
    elif operator == '-':
        result = num1 - num2
        print("结果为：", result)
    elif operator == '*':
        result = num1 * num2
        print("结果为：", result)
    elif operator == '/':
        result = num1 / num2
        print("结果为：", result)
    

while True:
    user_input = input('请输入要计算什么：')
    calculator(user_input)

    end = input("你想继续吗: [y/n]")
    if end != 'y':
        break